package com.ewzj.bigdata.mvp.ui.holder;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.ewzj.bigdata.R;
import com.ewzj.bigdata.mvp.model.entity.resbean.SearchResultHot;
import com.jess.arms.base.BaseHolder;

import butterknife.BindView;
import io.reactivex.Observable;

/**
 * Created by just__soso on 2018/1/31.
 */

public class SearchResuHotltItemHolder extends BaseHolder<SearchResultHot>{
    @BindView(R.id.search_result_item_icon)
    ImageView search_result_item_icon;
    @BindView(R.id.tv_tagname)
    TextView search_result_item_content;
    public SearchResuHotltItemHolder(View itemView){
        super(itemView);
    }
    @Override
    public void setData(SearchResultHot data, int position) {
        if (data.getType()==0)
        {
            search_result_item_icon.setImageResource(R.drawable.ic_icon_time);
        }else {
            search_result_item_icon.setImageResource(R.drawable.ic_icon_hot);
        }
        Observable.just(data.getMsg()).subscribe(s -> search_result_item_content.setText(s));
    }
}
